<?php
session_start();
include_once("../inc/conn.php");

if(isset($_SESSION["account_name"])==false)
{
	echo "0";
}
else
{
	$joke_id=str_replace("\"","'",trim($_POST["joke_id"]));
	
	date_default_timezone_set('PRC');
	$add_time=date("y-n-j H:i:s");
	
	$account_name=$_SESSION["account_name"];
	
	$sql="insert into favorite(account_name,joke_id,add_time) VALUES ";
	$sql=$sql ."('". $account_name."',";
	$sql=$sql . "'". $joke_id     ."',";
	$sql=$sql . "'". $add_time    ."')";
	
	mysql_query($sql);
	echo "1";
}
?>



